package main

import (
	"fmt"
	"time"
)

func main() {
	a := make(chan int, 1)
	go func() {
		var b int
		for {
			a <- b
			b++
			time.Sleep(1 * time.Second)
		}
	}()

	for desc := range a {
		if desc == 4 {
			break
		}
		fmt.Println(desc)
	}

}
